package hnlg.com.cn.hetongmanage.junit;

import java.util.HashMap;
import java.util.List;

import javax.annotation.Resource;

import org.junit.Test;
import org.junit.runner.RunWith;
import org.springframework.boot.test.context.SpringBootTest;
import org.springframework.test.context.junit4.SpringRunner;

import hnlg.com.cn.hetongmanage.service.IHetongService;
import hnlg.com.cn.model.HetongVo;

@SpringBootTest
@RunWith(SpringRunner.class)
public class HetongServiceImplTest {
@Resource IHetongService HetongService;
	@Test
	public void testAddHetong() throws Exception {
		HetongVo vo=new HetongVo();
		vo.setJzmc("基站3");vo.setHetong("C合同");
		vo.setDizhi("浙江绍兴");vo.setMianji("213");
		vo.setYzdh("133");vo.setYzmc("白总");
		HetongService.addHetong(vo);
	}

	@Test
	public void testDeleteHetong() throws Exception {
		HetongService.deleteHetong("1");
	}

	@Test
	public void testQueryHetong() throws Exception {
		HetongVo vo=new HetongVo();
		HetongService.queryHetong(vo);
	}

	@Test
	public void testUpdateHetong() throws Exception {
		HetongVo vo=new HetongVo();
		vo.setJzmc("基站5");vo.setHetong("E合同");
		vo.setDizhi("江苏苏州");vo.setMianji("123");
		vo.setYzdh("321");vo.setYzmc("陈总");
		vo.setId(2);HetongService.updateHetong(vo);
	}
	
	@Test
	public void testQueryByMultiplePara() throws Exception{
		List list1=HetongService.queryByMultiplePara("基站5", "2", "321");
		System.out.println("==list1"+list1);
	}
	@Test
	public void testQueryByHashMapPara() throws Exception{
		HashMap<String,String>map=new HashMap<String,String>();
		map.put("key_jzmc", "基站3");
		map.put("key_quyu_id", "2");
		map.put("key_yzdh", "133");
		List list1=HetongService.queryByHashMapPara(map);
		System.out.println("==list1"+list1);
	}
}
